<?php
	/*
	 * File: update_page_people.php
	 * Last modification: 21.07.2011
	 * Author(s): kivio.wanderley
	 * 
	 */
?>

<?php /** UPPER PHP CODE */
	$t_type = gpc_get('type_option_list');
	$t_type_id = gpc_get('type_id');
	
	if($t_type == 'people') {
		if(isset($t_type_id)) {
			# Post needed information for the given type and option
			$t_data = datab_get_type_data($t_type, $t_type_id);
		
			# Set post vars from 'datab_post_type_data'
			$t_people_row 	= $t_data['people_row'];
		}
	}

	# People vars
	require('update_page_people_vars.php');
?>

<div id="update_page_people_div1">
	<table><!-- Personal data -->
		<tr>
			<td><input type="checkbox" value="upd_first_name"/></td>
			<td><label><?php echo lang_get("first_name") . ":"; ?></label></td>
			<td><?php print_text_field("upd_first_name", "", $peo_first_name, 25, 25, false, "", true); ?></td>
			
			<td><input type="checkbox" value="upd_last_name"/></td>
			<td><label><?php echo lang_get("last_name") . ":"; ?></label></td>
			<td><?php print_text_field("upd_last_name", "", $peo_last_name, 25, 25, false, "", true);  ?></td>
		</tr>
		<tr>
			<td><input type="checkbox" value="upd_cpf"/></td>
			<td><label>CPF:</label></td>
			<td><?php print_text_field("upd_cpf", "", $peo_cpf, 14, 14, false, "", true); ?></td>
		</tr>
	</table><br />
	
	<hr>
</div>	

<?php /* Submit button and update type */
	if($t_type == 'people') {
		PRINT '<input type="hidden" name="type_id" value="'.$t_type_id.'">';
		PRINT '<input type="hidden" name="update_type" value="'.$t_type.'">';
		print_submit_button('update_button'); 
	}
?>

<script>
	$(document).ready(function () { 
		$("#upd_cpf").mask("999.999.999-99", {placeHolder:" "});
	});
</script>